[Unit]
Description=Redis In-Memory Data Store                       
After=network.target                                         
                                                             
[Service]                                                    
Type=simple                                                 
User=web                                                   
Group=web
PermissionsStartOnly=true                                    
PIDFile=/var/run/redis_{{ redis_port }}.pid                              
ExecStartPre=/bin/touch /var/log/redis/redis.log                   
ExecStartPre=/bin/chown web:web /var/log/redis/redis.log       
ExecStart={{redis_home}}/bin/redis-server {{redis_home}}/redis-{{redis_port}}.conf         
ExecStop={{redis_home}}/bin/redis-cli -p {{ redis_port }} shutdown
ExecReload=/bin/kill -USR2 $MAINPID                          
Restart=always                                               
RestartSec=3                                                 
                                                             
[Install]                                                    
WantedBy=multi-user.target  